﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T.FAS.Runtime.DataAccess.SPI
{
    public delegate void BuildDataAccessActionContext(InvokeContext context);
    public delegate List<ActionResult> ExecuteDataAccessAction(InjectionMethodType InjectMethodType, InjectionPoint InjectPoint, DataAccessPluginExtParam extExecuteData = null);

    public class ActionResult
    {
        /// <summary>
        /// 插件标识
        /// </summary>
        public string PluginCode { get; set; }

        /// <summary>
        /// 动作执行结果
        /// </summary>
        public bool Result { get; set; }

        /// <summary>
        /// 动作执行上下文
        /// </summary>
        public InvokeContext InvokeContext { get; set; }

        /// <summary>
        /// 动作执行内部信息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 如果内部有异常，保存异常信息
        /// </summary>
        public Exception Exception { get; set; }

        /// <summary>
        /// 主动获取插件执行结果
        /// </summary>
        public Dictionary<string, object> ResultData { get; set; }

        /// <summary>
        /// 异常处理类型
        /// </summary>
        public ActionErrorHandleType ActionErrorHandleType { get; set; }
    }
}
